﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections.Generic;
using System.Linq;

/** 
 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
 * Description: 
 * Author: Heller (HellerSong@outlook.com)
 * CreationTime: 3/28/2015 6:22:43 PM
 ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** 
 **/
namespace DevGrammar.TestBasic
{
	[TestClass]
	public class TestArray
	{
		[TestMethod]
		public void test_convert_list_to_array()
		{
			List<String> list = new List<string>();
			list.Add("test1");
			list.Add("test2");
			list.Add("test3");

			//DevGlobal.ShowArrayInfo(list.ToArray());
		}

		[TestMethod]
		public void test_array_initialition()
		{
			int[] numbers = new int[10];    // Default init is 0
			foreach (int n in numbers)
				Console.WriteLine(n);

			string[] names = new string[] { "Matt", "Joanne", "Robert" };
		}

		[TestMethod]
		public void test_join_two_array()
		{
			int[] front = { 1, 2, 3, 4 };
			int[] back = { 5, 6, 7, 8 };
			// In C# 3.0 you can use LINQ to accomplish this easily
			int[] combined = front.Concat(back).ToArray();
			//DevGlobal.ShowArrayInfo(combined);
		}

		[TestMethod]
		public void test_join_two_list()
		{
			List<int> list1 = new List<int>() { 1, 2, 3 };
			List<int> list2 = new List<int>() { 5, 6, 7 };

			list1.AddRange(list2);
			//DevGlobal.ShowListInfo(list1);
		}
	}
}
